package band.wukong.practice.springcloud.quickstart.qk02;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;

/**
 * @author wukong(wukonggg@139.com)
 */
@Service
public class HelloService {

    @Value("${app.serviceDirectory.hiService.uri}")
    private String uri;

    @Autowired
    private RestTemplate restTemplate;

    public String hiService(String name) {
        return restTemplate.getForObject(uri + "?name=" + name, String.class);
    }

}
